<?php

namespace app\admin\app\model;

use plugin\admin\app\model\Base;

/**
 * @property integer $id 主键(主键)
 * @property string $created_at 创建时间
 * @property string $updated_at 更新时间
 * @property string $path 素材
 * @property integer $subtitle 字幕
 * @property integer $mode 字幕方式
 * @property integer $status 状态
 * @property integer $category_id 分类
 * @property integer $admin_id 管理员
 */
class MaterialSubtitle extends Base
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'wa_material_subtitle';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    public function getPathAttribute($value)
    {
        return $value && strpos($value, 'http') === false ? config('qiniu.domain') . $value : $value;
    }

    public function getCoverAttribute($value)
    {
        return $value && strpos($value, 'http') === false ? config('qiniu.domain') . $value : $value;
    }
}
